<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <style>
        .checkbox-inline input[type=checkbox], .radio-inline input[type=radio] {
            margin-top: 4px;
        }
    </style>
</head>

<body style="color:#333;padding:3px;">
<!-- 标题 -->
<div class="page-heade">
    <h1 class="title_color">出库管理</h1>
</div>
<!-- 标题 -->
<div>
    <form action="" class="form-inline">
        <table class="row-margin-top tab-content table-bordered table text-left" border="1">
            <tr>
                <td colspan="6">
                    <label class="radio-inline">
                        <input type="radio" {if $qrck==='0'}checked{/if} name="kucun" id="io11" value="{:url('ckgl',['qrck'=>0])}">待确认的出库申请
                    </label>
                    <label class="radio-inline">
                        <input type="radio" {if $qrck==='1'}checked{/if} name="kucun" id="io21" value="{:url('ckgl',['qrck'=>1])}">已确认的出库申请
                    </label>
                    <label class="radio-inline">
                        <input type="radio" {if $qrck===null}checked{/if} name="kucun" id="io12" value="{:url('ckgl')}">所有出库申请
                    </label>
                </td>
            </tr>
            <tr>
                <td style="min-width: 140px" class="text-right"><label for="" class="form-label">出库申请单编号：</label></td>
                <td><input type="text" class="form-control" name="sn" value="{$sn}"></td>
                <td style="min-width: 140px" class="text-right"><label for="" class="form-label">订单编号：</label></td>
                <td><input type="text" class="form-control" name="order_sn" value="{$order_sn}"></td>
                <td style="min-width: 140px" class="text-right"><label for="" class="form-label">出库对象：</label></td>
                <td><input type="text" class="form-control" name="ckdx_name" value="{$ckdx_name}"></td>
            </tr>
            <tr>
                <td style="min-width: 140px" class="text-right"><label for="" class="form-label">类型：</label></td>
                <td>
                    <select name="wllx" id="" class="form-control">
                        <option value="">全部</option>
                        <option value="1" {if $wllx==1}selected{/if}>销售物料</option>
                        <option value="2" {if $wllx==2}selected{/if}>生产物料</option>
                        <option value="3" {if $wllx==3}selected{/if}>成品</option>
                    </select>
                </td>
                <td style="min-width: 140px;width: 140px" class="text-right"><label for="" class="form-label">方式：</label></td>
                <td>
                    <select name="ckfs" id="" class="form-control">
                        <option value="">全部</option>
                        <option value="手动入库" {if $ckfs=='手动入库'}selected{/if}>手动入库</option>
                        <option value="采购入库" {if $ckfs=='采购入库'}selected{/if}>采购入库</option>
                        <option value="调拨入库" {if $ckfs=='调拨入库'}selected{/if}>调拨入库</option>
                        <option value="生产入库" {if $ckfs=='生产入库'}selected{/if}>生产入库</option>
                    </select>
                </td>
                <td style="min-width: 140px;width: 140px" class="text-right"><label for="" class="form-label">申请时间：</label>
                </td>
                <td>
                    <div class="form-group">
                        <input type="text" id="start" name="start" value="{$start}" class="form-control layer-date "
                               style="min-width: 120px;width: 120px;display: inline-block;">
                    </div>
                    <div class="form-group">
                        到
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control layer-date"
                               style="min-width: 120px;width: 120px;display: inline-block;" id="end" name="end" value="{$end}">
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="6" class="text-center">
                    <button class="btn btn-info query" type="submit">查询</button>
                    <button class="btn btn-info emptyIf" type="button">清空查询条件</button>
                    <button class="btn btn-info LendExcel" type="button">导出Excel</button>
                </td>
            </tr>
        </table>
        <table class="table row-margin-top table-bordered table-hover text-center bud_hei" id="kuncunTable">
            <tr id="kuncunTable_th">
                <th colspan="14">
                    <button class="btn-info btn" type="button" id="setProduct">批量设置订单出库完毕</button>
                </th>
            </tr>
            <tr class="info" id="kuncunTable_th1">
                <th style="vertical-align: middle !important;text-align: center;"><input type="checkbox" id="checkAll">
                </th>
                <th class="text-center">No.</th>
                <th class="text-center">出库申请单编号</th>
                <th class="text-center">方式</th>
                <th class="text-center">订单编号</th>
                <th class="text-center">类型</th>
                <th class="text-center">数量</th>
                <th class="text-center">金额(元)<span class="helpText">帮</span></th>
                <th class="text-center">出库对象</th>
                <th class="text-center">申请人</th>
                <th class="text-center trTotal2">申请时间</th>
                <th class="text-center">确认人</th>
                <th class="text-center">确认时间</th>
                <th class="text-center">操作</th>
            </tr>
            {volist name="data" id="row" key="k"}
            <tr>
                <td align="center"><input type="checkbox" name="items"></td>
                <td>{$k+(request()->param('page')?request()->param('page'):1-1)*10}</td>
                <td><a href="{:url('cksqd_view',['id'=>$row.id])}" class="J_menuItem">{$row.sn}</a></td>
                <td>{$row.ckfs}</td>
                <td><a href="{:url('wdxsdd/view',['id'=>$row.order_id])}" class="J_menuItem">{$row.order_sn}</a></td>
                <td>{if $row.wllx==1}销售物料{elseif $row.wllx==2}生产物料{else}成品{/if}</td>
                <td>{$row.sqsl}</td>
                <td><span class="ObjectNum">{$row.zje}</span>00</td>
                <td class="text-left">{$row.ckdx_name}</td>
                <td>{$row.sqrmc}</td>
                <td>{$row.sqrq}</td>
                <td>{$row.qrrmc}</td>
                <td>{$row.qrrq}</td>
                <td>
                    {if $row.qrck==0}
                    <a href="{:url('sell_sure',['id'=>$row.id])}" class="sure_chuku">确认出库</a>&nbsp;
                    {/if}
                    <a href="{:url('cksqd_view',['id'=>$row.id])}" class="J_menuItem">查看详情</a>
                </td>
            </tr>
            {/volist}
            <tfoot>

            </tfoot>
        </table>
    </form>
      <div class="row text-center" id="pageText" style="padding: 0;margin: 0;">
					<div class="col-sm-6 text-left"><div class="padding-10 countSize">共{$count}条记录，{$maxpage}页&nbsp;&nbsp;</div></div>
				<div class="col-sm-6 text-right">{$page}</div>
		</div>
</div>
<!-- 全局js -->
<script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!--统计代码，可删除-->
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__STATIC__/layout/js/common.js"></script>
<script src="__STATIC__/layout/js/contabs_sub.js"></script>
<script>
    $('.emptyIf').on('click',function () {
        $(this).closest('form').find('input').val('')
        $(this).closest('form').find('select').val('')
        $(this).closest('form').submit()
    })
    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY-MM-DD',
        min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY-MM-DD',
        min: laydate.now(),
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);

    $(document).ready(function () {
        var $ObjectNum = $(".ObjectNum");
        toNum($ObjectNum);

        /*待确认的出库单、已确认的出库单、所有出库申请*/
        $("input:radio[name=kucun]").click(function () {
            location.href=$(this).val()
            /*if ($("#io11").prop("checked") == true) {
                location.href = "kucun_managment3.html"
            } else if ($("#io21").prop("checked") == true) {
                $(".sure_chuku").hide();
                $("#kuncunTable_th").hide();
                delCol();
            } else if ($("#io12").prop("checked") == true) {
                $(".sure_chuku").show();
                $("#kuncunTable_th").show();
                showCol();
            }*/
        });
        /*批量设置订单出库完毕*/
        $("#setProduct").click(function () {
            swal({
                    title: "",
                    text: "您确定把选中的订单设置为已出库完毕状态？请谨慎使用本功能！",
                    type: "warning",
                    showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    closeOnConfirm: true,
                    closeOnCancel: true
                },
                function () {
                    // location.href="add_system.html"
                });
        })

    })

    function delCol() {
        $("#kuncunTable #kuncunTable_th1").find("th").eq(0).hide();
        $("#kuncunTable>tbody>tr").each(function () {
            $(this).find("td").eq(0).hide();
        })
    }

    function showCol() {
        $("#kuncunTable #kuncunTable_th1").find("th").eq(0).show();
        $("#kuncunTable>tbody>tr").each(function () {
            $(this).find("td").eq(0).show();
        })
    }

    /*table表格操作*/
    $("#checkAll").click(function () {

        $("[name=items]:checkbox").prop("checked", $(this).prop("checked"));
        if ($("[name=items]:checkbox").prop("checked") != true) {
            // console.log($(this))
            $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#fff")
        } else {
            $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#f8f800")

        }
    })
    $("[name=items]:checkbox").click(function () {
        //定义一个临时变量，避免重复使用同一个选择器选择页面中的元素，提高程序效率
        // console.log(1)
        var $tmp = $("[name=items]:checkbox");
        if ($(this).prop("checked") != true) {
            // console.log($(this))
            $(this).parent().parent().css("backgroundColor", "#fff")
        } else {
            $(this).parent().parent().css("backgroundColor", "#f8f800")

        }
        //用filter()方法筛选出选中的复选框，并直接给CheckedAll赋值
        $("#checkAll").prop('checked', $tmp.length == $tmp.filter(':checked').length);

    })
</script>
</body>

</html>
